package com.ibm.cps.sql;

import java.util.HashMap;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.cps.message.MessageFields;
import com.ibm.factories.DataSourceFactory;
import com.ibm.util.JSONUtility;
import com.ibm.util.exception.CPSException;

/**
 * Created by telekinesis on 6/16/15.
 */
public class MockupProcessorFactory extends DataSourceFactory {
	private HashMap<String, String> topicToInputProcessorId = new HashMap();

	public MockupProcessorFactory() throws CPSException {
	}

	public void putTopicProcessorMapping(String topicName, String processorId) {
		ObjectNode node = JSONUtility.newObjectNode(MessageFields.PROCESSORID,
				processorId);
		topicToInputProcessorId.put(topicName, node.toString());
	}

	/**
	 * get input processor metadata according to topicname
	 * @param topicName
	 * @return
	 */
	public String replicateDataSource(String topicName) {
		return "MockupProcessorId_" + topicName;
	}

}
